package com.qdxwx.data.mapper.course;

import com.qdxwx.common.page.PageRequest;
import com.qdxwx.models.course.CourseStudyHistory;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * CourseStudyHistory接口
 * Qdx NetSchool Platform
 * @author qdxwx
 * @updateTime 2022/5/25
 * @description
 */
@Repository
public interface CourseStudyHistoryMapper {

    /**
     * 添加CourseStudyHistory
     * @param courseStudyHistory 要添加的CourseStudyHistory
     * @return id
     */
    int create(CourseStudyHistory courseStudyHistory);

    /**
     * 修改CourseStudyHistory
     * @param courseStudyHistory 要修改的CourseStudyHistory
     */
    void update(CourseStudyHistory courseStudyHistory);
    /**
     * 查看 某人的最近一条学习记录
     */
    CourseStudyHistory selectLastByUserId(long userId, int courseId);

    int deleteByIds(String[] ids);

    List<CourseStudyHistory> selectList(@Param("e") CourseStudyHistory courseStudyHistory, @Param("page") PageRequest page);

    int count(@Param("e") CourseStudyHistory courseStudyHistory);

    int updateCombine(long userId1, long userId2);
}